package com.ruoyi.wb.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wb.mapper.WbUserMapper;
import com.ruoyi.wb.domain.WbUser;
import com.ruoyi.wb.service.IWbUserService;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-14
 */
@Service
public class WbUserServiceImpl implements IWbUserService 
{
    @Autowired
    private WbUserMapper wbUserMapper;

    /**
     * 查询用户
     * 
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public WbUser selectWbUserById(Long id)
    {
        return wbUserMapper.selectWbUserById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param wbUser 用户
     * @return 用户
     */
    @Override
    public List<WbUser> selectWbUserList(WbUser wbUser)
    {
        return wbUserMapper.selectWbUserList(wbUser);
    }

    /**
     * 新增用户
     * 
     * @param wbUser 用户
     * @return 结果
     */
    @Override
    public int insertWbUser(WbUser wbUser)
    {
        wbUser.setCreateTime(DateUtils.getNowDate());
        return wbUserMapper.insertWbUser(wbUser);
    }

    /**
     * 修改用户
     * 
     * @param wbUser 用户
     * @return 结果
     */
    @Override
    public int updateWbUser(WbUser wbUser)
    {
        wbUser.setUpdateTime(DateUtils.getNowDate());
        return wbUserMapper.updateWbUser(wbUser);
    }

    /**
     * 批量删除用户
     * 
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deleteWbUserByIds(Long[] ids)
    {
        return wbUserMapper.deleteWbUserByIds(ids);
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deleteWbUserById(Long id)
    {
        return wbUserMapper.deleteWbUserById(id);
    }
}
